package com.katze.boot.zookeeper.service;

import com.katze.common.Message;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.net.URI;

@FeignClient(name = "zookeeper", url = "#", contextId = "ZookeeperService")
public interface FeignZookeeperService {

    @RequestMapping(value = "/exists", method = RequestMethod.GET)
    Message exists(URI uri, @RequestParam("id") String id);

    @RequestMapping(value = "/{method}", method = RequestMethod.POST)
    Message post(URI uri, @PathVariable("method") String method, @RequestBody Object entity);

    @RequestMapping(value = "/{method}", method = RequestMethod.PUT)
    Message put(URI uri, @PathVariable("method") String method, @RequestBody Object entity);

    @RequestMapping(value = "/{method}", method = RequestMethod.DELETE)
    Message delete(URI uri, @PathVariable("method") String method, @RequestParam("id") String id);
}
